package com.tjetc.service;

import com.alipay.api.AlipayClient;
import com.github.pagehelper.PageInfo;
import com.tjetc.common.JsonResult;
import com.tjetc.entity.Order;
import org.springframework.cglib.core.Local;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/***
 * 订单部分接口，实现订单的相关操作
 */
public interface OrderService {
    //用户下单后执行相关操作
    int addToOrder(Order order,List<Integer> list);
    //添加订单信息，管理员端
    int add(Order order);
    //id查询订单
    Order selectByOrderId(int id);
    //用户查询所有订单
    List<Order> selectByUserId(int userId);
    //查询用户等待支付订单
    List<Order> selectWaitPay(int userId);
    //查询用户待送达订单
    List<Order> selectWaitArrive(int userId);
    //查询用户待评论订单
    List<Order> selectWaitRemark(int userId);
    //查询用户售后处理的订单
    List<Order> selectAfterPay(int userId);
    //查询用户申请退款订单
    List<Order> selectRefund(int userId);
    //查询用户未完成订单
    List<Order> selectUnaccomplished(int userId);



    //商家查询所有本店商品订单
    List<Order> selectAllByMerchantId(int merchantId);
    //删除订单
    int delete(int id);
    // 更新订单
    Integer updateOrder(Order order);

    JsonResult<PageInfo> page(Order order, Integer pageNum, Integer pageSize);

    JsonResult alipay(Integer orderId);

    List<Order> getOrderByDayTime(LocalDateTime day, Integer merchantId);

    List<Order> getOrderByStartTimeAndEndTime(LocalDateTime start, LocalDateTime end);

    List<Order> getOrderByMonthTime(LocalDateTime month);

    List<Order> selectByOrderAndDay(Integer merchantId, LocalDateTime time);

    void refresh(LocalDateTime time, Integer id);

    void refreshDay(LocalDateTime time, Integer id);

    List<Order> searchOrderByCheckoutTime(Integer id, LocalDateTime time);

    int changeOrderStatus(int id,int status);

    JsonResult getMoneyInfo(LocalDateTime time);

    List<Order> getNoPayOrderByDuration(int minutes);


}
